package com.qiye.pointsserver.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qiye.pointsserver.common.PageUtil.PageParam;
import com.qiye.pointsserver.common.PageUtil.PageResult;
import com.qiye.pointsserver.model.dto.AutherDto;
import com.qiye.pointsserver.model.entity.Auther;
import com.qiye.pointsserver.service.AutherService;
import com.qiye.pointsserver.mapper.AutherMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Lenovo
* @description 针对表【sys_auther(其他资源积分表)】的数据库操作Service实现
* @createDate 2025-07-08 19:44:16
*/
@Service
public class AutherServiceImpl extends ServiceImpl<AutherMapper, Auther>
    implements AutherService{

    @Resource
    private AutherMapper autherMapper;

    @Override
    public PageResult<Auther> searchAuther(PageParam pageParam) {
        Page<Auther> page = new Page<>(pageParam.getPageNum(), pageParam.getPageSize());
        IPage<Auther> resultPage = autherMapper.searchPage(page, pageParam.getKeyword());
        return new PageResult<>(resultPage);
    }

    @Override
    public List<AutherDto> search() {
        List<AutherDto> autherDtoList = autherMapper.search();
        return autherDtoList;
    }

}




